package com.zenchn.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

@ApiModel(value="账户对象",description="账户对象")
public class TSysAccount implements Serializable {

    private static final long serialVersionUID = 2094989706364003370L;

    @ApiModelProperty(value="账户ID")
    private String accountId;

    @ApiModelProperty(value="创建时间",hidden = true)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @NotEmpty(message = "账号不能为空")
    @ApiModelProperty(value="账号")
    private String account;

    @ApiModelProperty(value="密码")
    private String password;

    @NotNull(message = "账号状态不能为空")
    @ApiModelProperty(value="账号状态")
    private Integer status;

    @NotEmpty(message = "姓名不能为空")
    @ApiModelProperty(value="姓名")
    private String realName;

    @ApiModelProperty(value="性别")
    private String sex;

    @NotEmpty(message = "手机号码不能为空")
    @ApiModelProperty(value="手机号码")
    private String tel;

    @ApiModelProperty(value="电子邮件")
    private String email;

    @ApiModelProperty(value="头像文件ID")
    private String portraitFileId;

    @ApiModelProperty(value="岗位类型ID")
    private String postTypeId;

    @ApiModelProperty(value="是否默认",hidden = true)
    private Boolean isDefault;

    @ApiModelProperty(value="到期时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private LocalDate expireTime;

    @ApiModelProperty(value="备注")
    private String memo;

    @ApiModelProperty(value="最后登录IP",hidden = true)
    private String finalLoginIp;

    @ApiModelProperty(value="最后登录时间",hidden = true)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime finalLoginTime;

    @ApiModelProperty(value="最后登录地区",hidden = true)
    private String finalLoginLocation;

    public String getAccountId() {
        return accountId;
    }

    public void setAccountId(String accountId) {
        this.accountId = accountId == null ? null : accountId.trim();
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account == null ? null : account.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName == null ? null : realName.trim();
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex == null ? null : sex.trim();
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel == null ? null : tel.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getPortraitFileId() {
        return portraitFileId;
    }

    public void setPortraitFileId(String portraitFileId) {
        this.portraitFileId = portraitFileId == null ? null : portraitFileId.trim();
    }

    public String getPostTypeId() {
        return postTypeId;
    }

    public void setPostTypeId(String postTypeId) {
        this.postTypeId = postTypeId == null ? null : postTypeId.trim();
    }

    public Boolean getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(Boolean isDefault) {
        this.isDefault = isDefault;
    }

    public LocalDate getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(LocalDate expireTime) {
        this.expireTime = expireTime;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo == null ? null : memo.trim();
    }

    public String getFinalLoginIp() {
        return finalLoginIp;
    }

    public void setFinalLoginIp(String finalLoginIp) {
        this.finalLoginIp = finalLoginIp == null ? null : finalLoginIp.trim();
    }

    public LocalDateTime getFinalLoginTime() {
        return finalLoginTime;
    }

    public void setFinalLoginTime(LocalDateTime finalLoginTime) {
        this.finalLoginTime = finalLoginTime;
    }

    public String getFinalLoginLocation() {
        return finalLoginLocation;
    }

    public void setFinalLoginLocation(String finalLoginLocation) {
        this.finalLoginLocation = finalLoginLocation == null ? null : finalLoginLocation.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", accountId=").append(accountId);
        sb.append(", createTime=").append(createTime);
        sb.append(", account=").append(account);
        sb.append(", password=").append(password);
        sb.append(", status=").append(status);
        sb.append(", realName=").append(realName);
        sb.append(", sex=").append(sex);
        sb.append(", tel=").append(tel);
        sb.append(", email=").append(email);
        sb.append(", portraitFileId=").append(portraitFileId);
        sb.append(", postTypeId=").append(postTypeId);
        sb.append(", isDefault=").append(isDefault);
        sb.append(", expireTime=").append(expireTime);
        sb.append(", memo=").append(memo);
        sb.append(", finalLoginIp=").append(finalLoginIp);
        sb.append(", finalLoginTime=").append(finalLoginTime);
        sb.append(", finalLoginLocation=").append(finalLoginLocation);
        sb.append("]");
        return sb.toString();
    }
}